<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/20
 * Time: 16:03
 */
namespace app\api\controller;

use app\api\Common;
use app\model\Information;
use app\model\MatchList;
use app\model\MatchLive;
use app\model\PhaseList;
use think\Db;
use think\Request;


class Index extends Common{

    public function a(){

        return view();
    }


    //首页资讯接口
    public function index_information()
    {

        $information_list = Information::where('dstatus',1)->paginate(6);

        return_json(1,'',$information_list);

    }

    /**
     * 首页资讯详情 H5
     */
    public function information_details()
    {
        //接收资讯id
        $information_id = request()->get('id');

        //查询资讯详情
        $information_des = Information::get($information_id);
//            dump($information_des);exit;
        //用户点击查看点击量加1
        $information_des->click  = $information_des->click+1;
//        $information_des->ctime = date("Y-m-d",$information_des->ctime);
        $status = $information_des->save();
        return view('',['information_des'=>$information_des]);

    }

}